import request from '../../utils/request'
import type {
  loginForm,
  loginResponseData,
  userinfoResponseData,
  logoutResponseData
} from './type.ts'
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout'
}
export const reqLogin = (data: loginForm) => {
  return request.post<any, loginResponseData>(API.LOGIN_URL, data)
}
export const reqUserinfo = () => {
  return request.get<any, userinfoResponseData>(API.USERINFO_URL)
}
export const reqLogOut = () => {
  return request.post<any, logoutResponseData>(API.LOGOUT_URL)
}
